﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

namespace NJL.WebUsers.Controls
{
    public partial class WUEnterPriseSpaceLeftTags : BaseUserControl
    {
        private readonly NJL.BLL.NJL_COMPANY bllCompany = new BLL.NJL_COMPANY();
        private readonly NJL.BLL.NJL_COMPANY_SERVICE bllService = new BLL.NJL_COMPANY_SERVICE();
        protected Model.NJL_COMPANY modelCompany;
        protected IList<Model.NJL_COMPANY_SERVICE> LIST_COMPANY_SERVICE;
        protected ArrayList ArrayTagList = new ArrayList();
        protected IList<Model.NJL_BOOK> LIST_BOOK;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                modelCompany = bllCompany.GetModel(Request.QueryString["id"].ToString());

                if (modelCompany != null)
                {
                    LIST_COMPANY_SERVICE = bllService.GetModelList("NJL_COMPANY_ID='" + modelCompany.ID + "'");

                    if (LIST_COMPANY_SERVICE != null)
                    {
                        for (int i = 0; i < LIST_COMPANY_SERVICE.Count; i++)
                        {
                            char[] charSplit = { ',' };
                            if (LIST_COMPANY_SERVICE[i].TAG != null)
                            {
                                string[] tags = LIST_COMPANY_SERVICE[i].TAG.Split(charSplit);

                                for (int j = 0; j < tags.Length; j++)
                                {
                                    if (tags[j] == "")
                                        continue;
                                    ArrayTagList.Add(tags[j]);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}